//
//  NotificationTableViewCell.m
//  Comma
//
//  Created by 张诗雨 on 15/1/17.
//  Copyright (c) 2015年 lanou3g.com 蓝鸥科技. All rights reserved.
//

#import "NotificationTableViewCell.h"
#import "Masonry.h"
#import "GlobalMacro.h"
#import "CheckBoxView.h"
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self;
@implementation NotificationTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        UIImageView *myPhoto = [UIImageView new];
        [self.contentView addSubview:myPhoto];
        [myPhoto setBackgroundColor:[UIColor grayColor]];
        self.myPhoto = myPhoto;
        
        UILabel *typeLable = [UILabel new];
        typeLable.textColor = REDCOLOR;
//        typeLable.font = BOLDDEFAULT_FONT(14.0f);
        typeLable.font = [UIFont boldSystemFontOfSize:14.0f];
        [self.contentView addSubview:typeLable];
        self.typeLable = typeLable;
        
        UILabel *myTitle = [UILabel new];
        [myTitle setTextColor:TEXTGREENCOLOR];
//        [myTitle setTextAlignment:NSTextAlignmentCenter];
//        [myTitle setFont:[UIFont fontWithName:@"lanLantinghei SC" size:28]];
//        myTitle.font = BOLDDEFAULT_FONT(28.0f);
        [myTitle setFont:[UIFont boldSystemFontOfSize:14.0f]];
        [self.contentView addSubview:myTitle];
        self.myTitle = myTitle;
        
        self.checkBox = [[CheckBoxView alloc] initWithFrame:CGRectMake(- 56, 8, 48, 48) IsCheck:NO];
        [self.contentView addSubview:_checkBox];    
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    WS(weakSelf);
    
    [self.myPhoto mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(weakSelf.mas_left).with.offset(8);
        make.top.equalTo(weakSelf.mas_top).with.offset(8);
//        make.size.mas_equalTo(CGSizeMake(weakSelf.frame.size.height - 16, weakSelf.frame.size.height - 16));
        make.width.mas_equalTo(@(32));
        make.height.mas_equalTo(@(32));
    }];
    self.myPhoto.layer.cornerRadius = 16;
    self.myPhoto.layer.masksToBounds = YES;
    [self.typeLable mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.mas_top).with.offset(0);
        make.left.equalTo(_myPhoto.mas_right).with.offset(8);
        make.width.mas_equalTo(@44);
        make.height.mas_equalTo(@(64 * 2 / 3));
    }];
    
    [self.myTitle mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(weakSelf.mas_top).with.offset(0);
        make.left.equalTo(_typeLable.mas_right).with.offset(0);
        make.width.mas_equalTo(@(SCREEN_WIDTH - 100));
        make.height.mas_equalTo(@(64 * 2 / 3));


    }];
    
    
}
- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
